package com.zjmzxfzhl.modules.purchase.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zjmzxfzhl.common.base.BaseEntity;
import com.zjmzxfzhl.common.validator.constraints.LengthForUtf8;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 【】实体类
 *
 * @author 庄金明
 */
@Getter
@Setter
@TableName("T_PURCHASE_MATERIAL")
public class PurchaseMaterial extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String materialCode;
    /**
     * 物料名称
     */
    @NotNull
    @LengthForUtf8(max = 128)
    private String materialName;

    /**
     * 物料规格
     */
    @LengthForUtf8(max = 128)
    private String materialSpecification;

    /**
     * 单价
     */
    @DecimalMax("99999.99")
    private BigDecimal unitPrice;

    /**
     * 单位
     */
    @LengthForUtf8(max = 10)
    private String unit;

    /**
     * 备注
     */
    @LengthForUtf8(max = 256)
    private String comment;

    /**
     * 类型
     */
    @LengthForUtf8(max = 128)
    private String materialType;

    /**
     * 版本号
     */
    private Integer materialVersion;
}
